<template>
  <Detail
    :name="infodetail.title"
    :Releasetime="infodetail.createtime"
    :author="infodetail.author"
    :number="infodetail.read_num"
    :cover_image="infodetail.cover_image"
    :content="infodetail.content"
  />
</template>

<script>
import Detail from "../../components/details";
export default {
  components: {
    Detail,
  },
  data() {
    return {
      detailid: "",
      infodetail: {},
    };
  },
  created() {
    this.detailid = this.$route.query.id;
    this.getinfodetail();
  },
  methods: {
    // 获取新闻详情
    async getinfodetail() {
      const { data: res } = await this.$axios.post("index/newsDetail", {
        id: this.detailid,
      });

      this.infodetail = res.data;
      console.log(this.infodetail);
    },
  },
};
</script>

<style>
</style>